Release Notes for MPASM(TM) Assembler version v5.00
30 September, 2005

-----------------------------------------------------------------
Table of Contents
-----------------------------------------------------------------
* Important MPLINK and MPLAB IDE Compatibility Note
* Command Line Device Options Supported
* Operating System Support List for v5.00
* Repairs and Enhancements Made in v5.00
* Known Problems
* Serial EEPROM Support
* Using MPASM Assembler
* Customer Support


----------------------------------------------------------------------
Important MPLINK and MPLAB IDE Compatibility Note
----------------------------------------------------------------------

Due to a change in COFF file format, MPASM v5.00 and later will
not be compatible with versions of MPLINK prior to v4.00 or
versions of the MPLAB IDE prior to v7.21.
MPASM v5.00 and later will have backward compatibility to earlier
versions at the source level only. Any existing object files or
libraries compiled with earlier versions of the tools will not link
using new versions of the tools. They will need to be re-assembled
from source.


-----------------------------------------------------------------
Command Line Device Options Supported
-----------------------------------------------------------------
10F200       10F202       10F204       10F206
10F220       10F222

12C508       12C508A      12C509       12C509A
12C671       12C672       12CE518      12CE519
12CE673      12CE674      12CR509A     12F508
12F509       12F510       12F629       12F635
12F675       12F683

14000

16C432       16C433       16C505       16C52
16C54        16C54A       16C54B       16C54C
16C55        16C554       16C557       16C558
16C55A       16C56        16C56A       16C57
16C57C       16C58A       16C58B       16C5X
16C61        16C62        16C620       16C620A
16C621       16C621A      16C622       16C622A
16C62A       16C62B       16C63        16C63A
16C64        16C642       16C64A       16C65
16C65A       16C65B       16C66        16C662
16C67        16C71        16C710       16C711
16C712       16C715       16C716       16C717
16C72        16C72A       16C73        16C73A
16C73B       16C74        16C745       16C747
16C74A       16C74B       16C76        16C765
16C77        16C770       16C771       16C773
16C774       16C781       16C782       16C84
16C923       16C924       16C925       16C926
16CE623      16CE624      16CE625      16CR54
16CR54A      16CR54B      16CR54C      16CR56A
16CR57A      16CR57B      16CR57C      16CR58A
16CR58B      16CR62       16CR620A     16CR63
16CR64       16CR65       16CR72       16CR83
16CR84       16CXX        16F505       16F506
16F54        16F57        16F59        16F627
16F627A      16F628       16F628A      16F630
16F636       16F639       16F648A      16F676
16F684       16F685       16F687       16F688
16F689       16F690       16F716       16F72
16F73        16F737       16F74        16F76
16F767       16F77        16F777       16F785
16F818       16F819       16F83        16F84
16F84A       16F87        16F870       16F871
16F872       16F873       16F873A      16F874
16F874A      16F876       16F876A      16F877
16F877A      16F88        16F913       16F914
16F916       16F917       16F946       16HV540

17C42        17C42A       17C43        17C44
17C752       17C756       17C756A      17C762
17C766       17CR42       17CR43       17CXX

18c242       18c252       18c442       18c452
18c601       18c658       18c801       18c858
18f1220      18F1230      18F1231      18f1320
18F1330      18F1331      18f2220      18F2221
18f2320      18F2321      18f2331      18f2410
18F24J10     18f242       18f2420      18LF2423*
18f2431      18f2439      18F2450*     18f2455
18f248       18f2480      18f2510      18F25J10
18f2515      18f252       18f2520      18LF2523*
18f2525      18f2539      18f2550      18f258
18f2580      18f2585      18f2610      18f2620
18f2680      18f2681      18f4220      18F4221
18f4320      18F4321      18f4331      18f4410
18F44J10     18f442       18f4420      18LF4423*
18f4431      18f4439      18F4450*     18f4455
18f448       18f4480      18f4510      18F45J10
18f4515      18f452       18LF4523*    18f4520
18f4525      18f4539      18f4550      18f458
18f4580      18f4585      18f4610      18f4620
18f6310      18f6390      18f4680      18f4681
18f6410      18f64J15     18f6490      18f65J10
18f65J15     18f6520      18f6525      18F6527
18f6585      18f66J10     18f66J15     18f6620
18f6621      18F6622      18f6627      18F66J60
18F66J65     18f6680      18f67J10     18f6720
18f6722      18F67J60     18f8310      18f8390
18f8410      18f84J15     18f8490      18f85J10
18f85J15     18f8520      18f8525      18F8527
18f8585      18f86J10     18f86J15     18f8620
18f8621      18F8622      18f8627      18F86J60
18F86J65     18f8680      18f87J10     18f8720
18f8722      18F87J60     18F96J60     18F96J65
18F97J60

EEPROM16     EEPROM8

rfPIC12C509AF    rfPIC12C509AG    rfPIC12F675F
rfPIC12F675H     rfPIC12F675K

*Note: New part support since last release

THE PARTS CORRESPONDING TO THESE OPTIONS MAY NOT ALL BE
COMMERCIALLY AVAILABLE.

These can be chosen through the introductory screen, on the command
line, or in source file.  The selections 16C5X, 16CXX, 17CXX, and
18CXX are supported as generic family indicators.

The selections EEPROM8 and EEPROM16 are provided for generic memory
product support.  Read below for a description of how to use MPASM
Assembler to generate files for programming Microchip Serial EEPROM
devices. Use files 'MCP250XX.INC' and 'MCP250XX.ASM' as references for
programming I/O expander (MCP250XX) devices. The file 'MCP250XX.ASM'
is in the 'TEMPLATE\CODE' directory under 'MPLAB'.

The standard header files have been updated to reflect these devices.
One header file, MEMORY.INC, is provided for generic memory product
support. Another header file, MCP250XX.INC, is provided for generic
MCP250XX device support.

NOTES:
       - Use the P12C509A.INC header file for the PIC12CR509A;
         use the P16C620A.INC header file for the PIC16CR620A.
       - Use the 16C5X.INC header file for the following device command
         line options:

                16C52
                16C54
                16CR54
                16C54A
                16CR54A
                16C54B
                16CR54B
                16C54C
                16CR54C
                16C55
                16C55A
                16C56
                16C56A
                16CR56A
                16C57
                16CR57A
                16CR57B
                16C57C
                16CR57C
                16C58A
                16CR58A
                16C58B
                16CR58B

       - Use the P16F5X.INC header file for the following device
         command line options:

                16F54
                16F57
                16F59


-----------------------------------------------------------------
Operating System Support List for v5.00
-----------------------------------------------------------------

MPASMWIN.EXE is the 32-bit Windows version of MPASM Assembler which
is distributed with MPLAB IDE and MPLAB C18.  It is supported by the
following platforms:

Windows 98     Windows NT     Windows ME
Windows 2000   Windows XP

MPASM.EXE is the command-line version of MPASM Assembler which is
distributed with MPLAB C18 only.  It is supported by the following
platforms:

Windows 98     Windows NT
Windows ME     Windows 2000   Windows XP

NOTE: MPASM.EXE does not support device file names greater than an 8.3
      format (e.g. p18f87J15.INC). Use MPASMWIN.EXE instead.


-----------------------------------------------------------------
Repairs and Enhancements Made in v5.00
-----------------------------------------------------------------

Early adopter part support has been added for these devices:
   18F4450
   18F2450
   18LF2423
   18LF2523
   18LF4423
   18LF4523

Problems resolved:

(22494) Register bits in the header files of devices 18F2620 and
        18F4620 were incorrect.

(25433) T08BIT was defined in the PIC18F4620 family datasheet,
        but T016BIT was in the include files.

(25456) PSA was defined in the PIC18F4680 family datasheet, but
        the include files contain T0PS3 instead of PSA bit for
        18F4680/4585/2680/2585.

(23915) Include files for 18F2331/2431 contain PORTD, but these
        devices do not have this port.

(26087) P18F8490.INC file was missing SFR BAUDCON1 and bits for
        PIR3.LCDIF, IPR3.LCDIP and PIE3.LCDIE.

(26088) Pin P1C was defined as bit 7 in the P18F1320.INC file
        when it should be bit 6.

(26983) T0PS3 was defined instead of PSA in the include files for
        the following devices:
        18F4580/4480/2580/2480.
        Bit name PSA in T0CON register was added.

(26984) T16BIT was defined instead of T08BIT in the include files
        for the following devices:
        18F2410/2510/2515/2610/4410/4510/4515/4610
        T08BIT in T0CON register was added.

(27504) Corrected SFR register and bit names for 16F506 and
        12F510 to match the data sheet (DS41268A).

(27500) Configuration word for P10F220/222 did not match the
        data sheet (DS41270A) for bit 0. Updated the .INC file
        to use IOSCFS to match the data sheet.

-----------------------------------------------------------------
Known Problems
-----------------------------------------------------------------

The following is a list of known problems.  For a list of
limitations, please see MPASM Assembler Help, Troubleshooting,
Assembler Limitations.

(1008)  There are no warnings when overflow or underflow occurs
        during expression evaluation.

(16921) MPASM Assembler generates a COD file which cannot handle line
        number information for program memory addresses greater than
        64K. This adversely affects debugging.
        The workaround is to generate a .O file, link with MPLINK
        Linker, and debug in MPLAB IDE v6.0 or greater.

        Here is an example of what might happen. Suppose the source is

        ORG 0xF00000
        DB 0xAB ; eedata
        ORG 0x0
        MOVLW 3
        MOVLW 4

        The disassembly window in MPLAB IDE may appear this way:

        Disassembly               Source
                                  ORG 0xF00000
        000000 0E03 MOVLW 3       DB 0xAB
                                  ORG 0x0
                                  MOVLW 3
        000000 0E04 MOVLW 4       MOVLW 4

        The source line for address 0xF00000 has been associated with
        the code at address 0x0.

(17233) Errors in macros in an include file can be reported in an asm
        file that includes it. If a macro is defined in an include file
        and called in an asm file, MPASM reports errors, warnings, and
        messages in the macro definition as errors, warnings, and
        messages in the asm file, but using line numbers from the
        include file.

(17236) Using a symbol other than one introduced by the DEFINE
        directive as the operand of an IFDEF or IFNDEF directive
        causes the IFDEF/IFNDEF to possibly be evaluated incorrectly.

(18510) A file register operand which is greater than the absolute max
        ram address does not generate a message of any kind.
        For example,

        LIST P=18F452
        MOVWF 0x1000
        END

        will assemble without warning.

(18811) MPASMWIN generates incorrect code for 'goto' targeting a
        local label.
        A 'goto' targeting a local label is generating an instruction
        where the file register field is set to 0 instead of the local
        label's value.
        The workaround is to use the "$ + n" expression as the target
        of the 'goto'.

(19703) The Japanese directory delimiter character on Windows XP-J and
        Windows ME-J is not accepted by MPASM.
        The workaround is to invoke MPASM on the command line with
        a source file path which does not contain any directory
        delimiters.

(19788) MPASM.EXE has problems accepting a file name which contains
        a space just before the '.' character of the extension.
        For example,

        MPASM.EXE /Q "TEST .ASM"

        will cause a 'file not found' error, but for MPASMWIN.EXE, this
        is acceptable.

(20776) The return value of the MPASMWIN.EXE process (returned by
        'spawnvp') does not get stored in the DOS environment variable
        ERRORLEVEL.

(20986) When assembling with the '/o' option,
        a duplicate address label declaration causes no error, warning,
        or message. For example, the program fragment

        U1 IDATA
        X  DB 1
        U2 IDATA
        X  DB 2
            CODE
           MOVWF X

        assembles quietly, but the definition of X which is used in the
        MOVWF instruction is not well defined.

(21677) When using MPASM.EXE without the '/q' option, and an output
        file is specified to be in a nonexistent directory, then the
        output file is not generated, but no error message is emitted.
        When the '/q' option is used, the message "Couldn't open
        file..." is emitted. This can be confusing.

(21798) The length of the command line argument string to mpasm.exe is
        limited to about 120 characters. Anything beyond that is
        truncated.

(21988) MPASM cannot handle a source file with UNIX-style line endings.
        Please convert line endings to the DOS (CR/LF) format.

(22227) Error messages are not emitted to standard out.

(22387) MPASM cannot assemble files in Unicode format.

(22541) A warning is not emitted if the operand for the PUSHL
        instruction is less than -128, only if it is less than -255.
        A warning should be emitted if the operand is less than -128,
        since the operand is 8 bits wide.

(22660) When assembling with '/o' and the operand of a DT directive is
        relocatable but more than 8 bits wide, the linker will fill
        both bytes of the directive with 16 bits of the operand
        (instead of truncating the operand to 8 bits for a RETLW
        instruction):

          UDATA 0x124
          X RES 1
          CODE 0x100
          DT X

        will generate 0x0124 at address 0x100 instead of 0x3424
        (RETLW 0x24).

(23071) The LIST n=nnn directive does not properly format the
        listing file.

(23355) EEDATA at address 0xF00000 and an instruction at address 0x0:

        Given this program (for single-file disassembly):

        ORG 0xF00000; eedata
        DB 0xAB
        ORG 0x0
        MOVLW 3
        MOVLW 4
        END

        Produces the following in the MPLAB disassembly window:

                             1: LIST P=18F8720
                             2:
                             3: ORG 0xF00000
        000000 0E03 MOVLW 3  4: DB 0xAB
                             5:
                             6: ORG 0x0
                             7: MOVLW 0x3
        000000 0E04 MOVLW 4  8: MOVLW 0x4

(23490) As MPASM rescans macro expressions, it searches the substituted
        arguments for parameters.  E.g.,

        #define F(X,Y) X + Y
        Y EQU 2
        movlw F(Y,1)

        will yield movlw 2 instead of movlw 3.  After Y is substituted
        in place of X, it is replaced itself by the second argument
        upon rescanning.

(23747) MAXROM is defined incorrectly for 17C43.
        The following source code:

          LIST p=17c43
          ORG 0xFFE
          NOP
          ....
          ORG 0xFFFE
          NOP
          ....
          END

        Should cause the assembler to emit warning[220] when the code
        crosses 0x1000. Instead the assembler emits a warning when the
        code crosses 0x10000.
        Also note that "__maxrom 0xFFF" causes the assembler to emit
        the following error:
        Error[126] MAXROM.ASM 3 : Argument out of range (must be
        greater than or equal to 65535)
        As a workaround:

          LIST p=17c43
          __maxrom 0xFFFF
          __badrom 0x1000 - 0xFFFF
          ORG 0xFFE
          NOP
          ....
          END

        Causes the assembler to emit "Invalid ROM location,"
        warning[228], when the code crosses 0x1000.

(24275) After a file is compiled, the debug information does not seem
        to be loaded.

(24560) No error or warning is produced for the following code:

        bsf   ,1
        END

        This assembles as if "bsf 0,1" was given.

(24712) GPIO SFR bits GP3, GP2, GP1, and GP0 are not defined in the
        .INC files for the PIC10F20X devices.

(24794) MPASM generates invalid PIC18 relocation for $+<odd offset>.
        The following code, containing an invalid goto destination
        address, assembles without error when generating an object
        file (18f452):

                      code 0
                      bra start

        startscn      code 0x100
        start         nop
                      goto $-1
                      bra $

                      end

        causing a link-time error

        Error - file 'C:\test\mpasm\gotoneg1.o', section 'startscn',
        Symbol '_startscn_0102' is not word-aligned.
        It can not be used as the target of a call or goto instruction.

        However, the assembler generates a warning when assembling
        equivalent code in absolute mode:
                      org 0
                      bra start

                      org 0x100
        start         nop
                      goto $-1
                      bra $

                      end

        Warning[226] C:\TEST\MPASM\GOTONEG1.ASM 8 : Destination address
        must be word aligned

(25130) Incorrect error message given for RES directive.
        The following code:

              list p=18f452
              F CODE
              ORG 1
              foo res 2
              end

        produces this message:

        Error[158] C:\MPASM\SOURCE\TRES.ASM 4 : Cannot use RES
        directive with odd number of bytes

        RES has a value of 2 which is even. The ORG 1 is causing an odd
        boundary which is what the error message should describe.

(25131) The following code does not produce the expected raw data in
        the coff file nor does it give the user a warning that no
        memory has been reserved.

             list p=18f452
             Z CODE
             baz res 1
             end

(26223) MPASM does not correctly handle Windows CLI and DOS command
        line string limitations and error diagnostics can be ambiguous
        or absent.

(26588) The Processor Type list in the MPASM.EXE GUI (DOS executable)
        doesn't display all of the processors. Many 16xxx and all 18xxx
        processors are not shown.
        The workaround is to use the MPASMWIN.EXE GUI.


-----------------------------------------------------------------
Serial EEPROM Support
-----------------------------------------------------------------

Two "processor" selections are provided to generate byte data - EEPROM8
and EEPROM16.  Both generate data in terms of bytes, but EEPROM8
considers a "word" to be 8 bits wide, while EEPROM16 considers a "word"
to be 16 bits wide. The "program counter" is always incremented in
terms of bytes.

The default size for memory products is 128 bytes. This can be
overridden by using the LIST M=<max address> directive.  Note that
<max address> is always evaluated as a decimal number. The header file
MEMORY.INC is provided to define the maximum address for available
memory devices. The format of the defined symbols is _<device>; for
example, to set the maximum memory size for a 24LCS21, use the
directive LIST M=_24LCS21.

The following data generation directives are supported for
memory products:

        DW           FILL        ORG

The behavior of other data generation directives is not guaranteed.
All other directives are unchanged.

An example of generating a file for programming a memory device is
as follows:

;*************************************************
; Generate data for a 8-bit wide memory device.

        LIST    P=EEPROM8, R=DECIMAL
        INCLUDE "MEMORY.INC"
        LIST    M=_24LCS21

#DEFINE MAX_VALUE       255

        ORG     0

;-------------------------------------------------
; Create a packed-byte, null terminated string.

        DW      "Hello World", 0

;-------------------------------------------------
; Create data representing a line.  The X position
; is implied from the position of the data in the
; device.  The Y values are stored in the device.

; First, define an equation for the line.

#DEFINE Line( X )       Slope * X + Y_Intercept

; Now define the values needed for the equation.

Slope                   EQU     10
Y_Intercept             EQU     5

; Declare and initialize the X and Y values.

        VARIABLE        X = 0, Y = Line( X )

; Generate values until the maximum Y value is
; reached or the device is filled up.

        WHILE (Y <= MAX_VALUE) && ($ <= _24LCS21)
           DW   Y
X = X + 1
Y = Line( X )
        ENDW

;-------------------------------------------------
; Perform some checking based on the line data
; generated above.

; If the device filled up before the end of the
; line was reached, generate an error. Otherwise,
; if the device is almost out of room, generate a
; message.

        IF (Y < MAX_VALUE)
           ERROR        "Device is full."
        ELSE
           IF (($+10) > _24LCS21)
              MESSG     "Device is nearly full."
           ENDIF
        ENDIF

;-------------------------------------------------
; Fill the rest of the device with zeroes.

        FILL    0, _24LCS21 - $ + 1

        END

CLRW COMMAND:

The CLRW encoding was changed on all 14-bit core devices from 0x0100
to 0x0103 (v1.40 and later). This will not affect the expected
operation of the instruction, but it will change the value for the
instruction in the hex file and therefore the checksum.


WARNING MESSAGE:

The text for Message #302 was modified to explain more clearly that
bank indication bits are stripped when assembling instructions that
access file registers. The appropriate bank must be selected by the
appropriate bank selection bits. For example, 14-bit core devices
contain the lower seven bits of the file register address in the
opcode, with two bank selection bits in the STATUS register. The
message was changed from:
        Argument out of range. Least significant bits used.
to:
        Register in operand not in bank 0. Ensure that bank
        bits are correct.


END DIRECTIVE:

Take care to not use the END directive in a macro. If the END directive
is encountered in a macro, it can cause the assembler to loop
indefinitely. Macros should be terminated with the ENDM directive.


-----------------------------------------------------------------
Using MPASM Assembler
-----------------------------------------------------------------

Create your source code with any text editor. The file should contain
ASCII text only. Assemble your code with the command line:

        mpasm <file>[.asm]

A version of MPASM Assembler is also available for Windows. To invoke
this assembler, execute:

        mpasmwin

from within Windows. You will then be given a Windows interface window.
Help on using the interface is provided on-line. MPASMWIN.EXE can also
be invoked with parameters or through drag-and-drop. In these cases,
the interface screen is not displayed and assembly begins immediately.

Correct any syntax problems, referring to the MPASM Assembler, MPLINK
Object Linker, MPLIB Object Librarian User's Guide(DS33014) for
syntax help. MPASM assembles with INHX32 as the default hex output, and
generates a listing file, error file, and .COD file.


-----------------------------------------------------------------
Customer Support
-----------------------------------------------------------------

The Microchip Web Site
----------------------

Microchip provides online support via our web site at:
http://www.microchip.com
This web site is used as a means to make files and information easily
available to customers. Accessible by using your favorite Internet
browser, the web site contains the following information:

* Product Support - Data sheets and errata, application notes and
  sample programs, design resources, user's guides and hardware
  support documents, latest software releases and archived software

* General Technical Support - Frequently Asked Questions (FAQs),
  technical support requests, online discussion groups, Microchip
  consultant program member listing

* Business of Microchip - Product selector and ordering guides, latest
  Microchip press releases, listing of seminars and events, listings of
  Microchip sales offices, distributors and factory representatives

Development Systems Customer Change Notification Service
--------------------------------------------------------

Microchip's customer notification service helps keep customers current
on Microchip products. Subscribers will receive e-mail notification
whenever there are changes, updates, revisions or errata related to
a specified product family or development tool of interest.

To register, access the Microchip web site at www.microchip.com, click
on Customer Change Notification and follow the registration
instructions.

The Development Systems product group categories are:

* Compilers - The latest information on Microchip C compilers and other
  language tools. These include the MPLAB C18 and MPLAB C30 C
  compilers; MPASM(TM) and MPLAB ASM30 assemblers; MPLINK(TM) and
  MPLAB LINK30 object linkers; and MPLIB(TM) and MPLAB LIB30 object
  librarians.

* Emulators - The latest information on Microchip in-circuit emulators.
  This includes the MPLAB ICE 2000 and MPLAB ICE 4000.

* In-Circuit Debuggers - The latest information on the Microchip
  in-circuit debugger, MPLAB ICD 2.

* MPLAB IDE - The latest information on Microchip MPLAB IDE, the
  Windows(R) Integrated Development Environment for development systems
  tools. This list is focused on the MPLAB IDE, MPLAB IDE Project
  Manager, MPLAB Editor and MPLAB SIM simulator, as well as general
  editing and debugging features.

* Programmers - The latest information on Microchip programmers. These
  include the MPLAB PM3 and PRO MATE(R) II device programmers and the
  PICSTART(R) Plus, PICkit(TM) 1, and PICkit 2 development programmers.

Additional Support
------------------

Users of Microchip products can receive assistance through several
channels:

* Distributor or Representative
* Local Sales Office
* Field Application Engineer (FAE)
* Technical Support

Customers should contact their distributor, representative or field
application engineer (FAE) for support. Local sales offices are also
available to help customers. A listing of sales offices and locations
is available on our website.

Technical support is available through the web site at:
http://support.microchip.com

